<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Service - Documentation</title>

    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Git.html">Git</a><ul class='methods'><li data-type='method'><a href="Git.html#.close">close</a></li><li data-type='method'><a href="Git.html#.create">create</a></li><li data-type='method'><a href="Git.html#.exists">exists</a></li><li data-type='method'><a href="Git.html#.handle">handle</a></li><li data-type='method'><a href="Git.html#.list">list</a></li><li data-type='method'><a href="Git.html#.listen">listen</a></li><li data-type='method'><a href="Git.html#.mkdir">mkdir</a></li></ul></li><li><a href="HttpDuplex.html">HttpDuplex</a><ul class='methods'><li data-type='method'><a href="HttpDuplex.html#addTrailers">addTrailers</a></li><li data-type='method'><a href="HttpDuplex.html#cork">cork</a></li><li data-type='method'><a href="HttpDuplex.html#destroy">destroy</a></li><li data-type='method'><a href="HttpDuplex.html#end">end</a></li><li data-type='method'><a href="HttpDuplex.html#getHeader">getHeader</a></li><li data-type='method'><a href="HttpDuplex.html#pause">pause</a></li><li data-type='method'><a href="HttpDuplex.html#removeHeader">removeHeader</a></li><li data-type='method'><a href="HttpDuplex.html#resume">resume</a></li><li data-type='method'><a href="HttpDuplex.html#setDefaultEncoding">setDefaultEncoding</a></li><li data-type='method'><a href="HttpDuplex.html#setEncoding">setEncoding</a></li><li data-type='method'><a href="HttpDuplex.html#setHeader">setHeader</a></li><li data-type='method'><a href="HttpDuplex.html#uncork">uncork</a></li><li data-type='method'><a href="HttpDuplex.html#write">write</a></li><li data-type='method'><a href="HttpDuplex.html#writeContinue">writeContinue</a></li><li data-type='method'><a href="HttpDuplex.html#writeHead">writeHead</a></li><li data-type='method'><a href="HttpDuplex.html#writeHeader">writeHeader</a></li></ul></li><li><a href="Service.html">Service</a><ul class='methods'><li data-type='method'><a href="Service.html#.accept">accept</a></li><li data-type='method'><a href="Service.html#.reject">reject</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-lib_util.html">lib/util</a><ul class='methods'><li data-type='method'><a href="module-lib_util.html#~basicAuth">basicAuth</a></li><li data-type='method'><a href="module-lib_util.html#~createAction">createAction</a></li><li data-type='method'><a href="module-lib_util.html#~infoResponse">infoResponse</a></li><li data-type='method'><a href="module-lib_util.html#~noCache">noCache</a></li><li data-type='method'><a href="module-lib_util.html#~onExit">onExit</a></li><li data-type='method'><a href="module-lib_util.html#~parseGitName">parseGitName</a></li><li data-type='method'><a href="module-lib_util.html#~serviceRespond">serviceRespond</a></li></ul></li></ul><h3>Events</h3><ul><li><a href="HttpDuplex.html#event:close">close</a></li><li><a href="HttpDuplex.html#event:data">data</a></li><li><a href="HttpDuplex.html#event:drain">drain</a></li><li><a href="HttpDuplex.html#event:end">end</a></li><li><a href="HttpDuplex.html#event:error">error</a></li><li><a href="Git.html#event:fetch">fetch</a></li><li><a href="Git.html#event:head">head</a></li><li><a href="Git.html#event:info">info</a></li><li><a href="Git.html#event:push">push</a></li><li><a href="Git.html#event:tag">tag</a></li></ul><h3>Global</h3><ul><li><a href="global.html#getType">getType</a></li></ul>
</nav>

<div id="main">
    
    <h1 class="page-title">Service</h1>
    

    




<section>

<header>
    
        <h2>
        Service
        </h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    

    <h4 class="name" id="Service"><span class="type-signature"></span>new Service<span class="signature">(opts, req, res)</span><span class="type-signature"></span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="service.js.html">service.js</a>, <a href="service.js.html#line20">line 20</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Handles invoking the git-*-pack binaries</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>opts</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            

            

            <td class="description last"><p>options to bootstrap the service object</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>req</code></td>
            

            <td class="type">
            
                
<span class="param-type">http.IncomingMessage</span>


            
            </td>

            

            

            <td class="description last"><p>http request object</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>res</code></td>
            

            <td class="type">
            
                
<span class="param-type">http.ServerResponse</span>


            
            </td>

            

            

            <td class="description last"><p>http response</p></td>
        </tr>

    
    </tbody>
</table>
















    
    </div>

    
        <h3 class="subsection-title">Extends</h3>

        


    <ul>
        <li><a href="HttpDuplex.html">HttpDuplex</a></li>
    </ul>


    

    

    

     

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id="connection"><span class="type-signature">(readonly) </span>connection<span class="type-signature"> :net.Socket</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line72">line 72</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#connection">HttpDuplex#connection</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://nodejs.org/api/http.html#http_request_socket">request.Socket</a></li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>Reference to the underlying socket for the request connection.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">net.Socket</span>


        </li>
    </ul>






        
            
<h4 class="name" id="method"><span class="type-signature">(readonly) </span>method<span class="type-signature"> :String</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line136">line 136</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#method">HttpDuplex#method</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://nodejs.org/api/http.html#http_event_request">request</a></li>
        
            <li><a href="https://nodejs.org/api/http.html#http_class_http_serverresponse">http.ServerResponse</a></li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>Request method of the incoming request.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">String</span>


        </li>
    </ul>





    <h5>Example</h5>
    
    <pre class="prettyprint"><code>'GET', 'DELETE'</code></pre>



        
            
<h4 class="name" id="readable"><span class="type-signature">(readonly) </span>readable<span class="type-signature"> :Boolean</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line145">line 145</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#readable">HttpDuplex#readable</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Is this stream readable.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Boolean</span>


        </li>
    </ul>






        
            
<h4 class="name" id="req"><span class="type-signature"></span>req<span class="type-signature"> :http.IncomingMessage</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line33">line 33</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#req">HttpDuplex#req</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://nodejs.org/api/http.html#http_event_request">request</a></li>
        
            <li><a href="https://nodejs.org/api/http.html#http_class_http_incomingmessage">http.IncomingMessage</a></li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>A IncomingMessage created by http.Server or http.ClientRequest usually passed as the
first parameter to the 'request' and 'response' events. Implements Readable Stream interface
but may not be a decendant thereof.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">http.IncomingMessage</span>


        </li>
    </ul>






        
            
<h4 class="name" id="res"><span class="type-signature"></span>res<span class="type-signature"> :http.ServerResponse</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line42">line 42</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#res">HttpDuplex#res</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://nodejs.org/api/http.html#http_event_request">request</a></li>
        
            <li><a href="https://nodejs.org/api/http.html#http_class_http_serverresponse">http.ServerResponse</a></li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>Created http.server. Passed as the second parameter to the 'request' event.
The response implements Writable Stream interface but isn't a descendent thereof.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">http.ServerResponse</span>


        </li>
    </ul>






        
            
<h4 class="name" id="socket"><span class="type-signature">(readonly) </span>socket<span class="type-signature"> :net.Socket</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line155">line 155</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#socket">HttpDuplex#socket</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://nodejs.org/api/net.html#net_class_net_socket">net.Socket</a></li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>net.Socket object associated with the connection.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">net.Socket</span>


        </li>
    </ul>






        
            
<h4 class="name" id="statusCode"><span class="type-signature"></span>statusCode<span class="type-signature"> :Number</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line166">line 166</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#statusCode">HttpDuplex#statusCode</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    
    <dt class="tag-default">Default Value:</dt>
    <dd class="tag-default"><ul class="dummy">
            <li>200</li>
        </ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://nodejs.org/api/http.html#http_response_statuscode">response.statusCode</a></li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>The HTTP status code. Generally assigned before sending headers for a response to a client.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Number</span>


        </li>
    </ul>





    <h5>Example</h5>
    
    <pre class="prettyprint"><code>request.statusCode = 404;</code></pre>



        
            
<h4 class="name" id="statusMessage"><span class="type-signature"></span>statusMessage<span class="type-signature"> :String</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line182">line 182</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#statusMessage">HttpDuplex#statusMessage</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    
    <dt class="tag-default">Default Value:</dt>
    <dd class="tag-default"><ul class="dummy">
            <li>undefined</li>
        </ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://nodejs.org/api/http.html#http_response_statusmessage">response.statusMessage</a></li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>Controls the status message sent to the client as long as an explicit call to response.writeHead() isn't made
If ignored or the value is undefined, the default message corresponding to the status code will be used.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">String</span>


        </li>
    </ul>





    <h5>Example</h5>
    
    <pre class="prettyprint"><code>request.statusMessage = 'Document Not found';</code></pre>



        
            
<h4 class="name" id="trailers"><span class="type-signature">(readonly) </span>trailers<span class="type-signature"> :Object</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line190">line 190</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#trailers">HttpDuplex#trailers</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="HttpDuplex.html#headers">headers</a></li>
        
            <li><a href="HttpDuplex.html#addTrailers">addTrailers</a></li>
        
            <li><a href="https://nodejs.org/api/http.html#http_message_trailers">message.trailers</a></li>
        
            <li><a href="https://nodejs.org/api/http.html#http_response_addtrailers_headers">response.addTrailers</a></li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>Request/response trailer headers. Just like <a href="HttpDuplex.html#headers"><code>headers</code></a> except these are only written
after the initial response to the client.
This object is only populated at the 'end' event and only work if a 'transfer-encoding: chunked'
header is sent in the initial response.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Object</span>


        </li>
    </ul>






        
            
<h4 class="name" id="upgrade"><span class="type-signature">(readonly) </span>upgrade<span class="type-signature"> :Boolean</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line213">line 213</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#upgrade">HttpDuplex#upgrade</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="https://nodejs.org/api/http.html#http_event_upgrade_1">upgrade</a></li>
        </ul>
    </dd>
    

    
</dl>





<div class="description">
    <p>Whether or not the client connection has been upgraded</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Boolean</span>


        </li>
    </ul>






        
            
<h4 class="name" id="url"><span class="type-signature">(readonly) </span>url<span class="type-signature"> :String</span></h4>





<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="http-duplex.js.html">http-duplex.js</a>, <a href="http-duplex.js.html#line226">line 226</a>
    </li></ul></dd>
    

    

    

    
    <dt class="inherited-from">Inherited From:</dt>
    <dd class="inherited-from"><ul class="dummy"><li>
        <a href="HttpDuplex.html#url">HttpDuplex#url</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>Request URL string.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">String</span>


        </li>
    </ul>





    <h5>Examples</h5>
    
        <p class="code-caption">A request made as:</p>
    
    <pre class="prettyprint"><code>GET /info?check=none HTTP/1.1</code></pre>

        <p class="code-caption">Will return the string</p>
    
    <pre class="prettyprint"><code>'/info?check=none'</code></pre>



        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id=".accept"><span class="type-signature">(static) </span>accept<span class="signature">()</span><span class="type-signature"></span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="service.js.html">service.js</a>, <a href="service.js.html#line198">line 198</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>accepts request to access resource</p>
</div>

























        
            

    

    <h4 class="name" id=".reject"><span class="type-signature">(static) </span>reject<span class="signature">(code, msg)</span><span class="type-signature"></span></h4>

    




<dl class="details">

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="service.js.html">service.js</a>, <a href="service.js.html#line181">line 181</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>





<div class="description">
    <p>reject request in flight</p>
</div>











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>code</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last"><p>http response code</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>msg</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"><p>message that should be displayed on teh client</p></td>
        </tr>

    
    </tbody>
</table>
















        
    

    

    
</article>

</section>




</div>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>